#use "test13_parser.ml";;

(* debug := true;; *)

let rec post_string s i p = (
	let length = String.length s in
	if i >= length then (
		post (length + 1) '\x1a' p
	) else (
		let p = post (i + 1) s.[i] p in
		post_string s (i + 1) p
	)
);;

let p = create ();;
let p = post_string "1E" 0 p;;

flush stderr;;

if accepted p then (
	begin match result p with
	| Some (Some (Term (Some '1')), None, Some 'E') ->
		begin match errors p with
		| [2, Expected [';']] ->
			print_string "OK.\n";
		| _ ->
			raise (Failure "BAD ERRORS DETECTED!!")
		end
	| _ ->
		raise (Failure "BAD RESULT!!")
	end
) else (
	raise (Failure "NOT ACCEPTED!!")
);;
